<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <script>
        $(function(){
            var todolist = [{
                title:'我今天吃了八个包子',
                done:false

            },{
                title:'我今天学习jQuery',
                done:false

            }]
            //存储数据时需要转为字符串
            localStorage.setItem("todo",JSON.stringify(todolist));
            //取值的时候需要把字符串转回原来的字符串数据转换为数组对象 JSON.parse();
            var data = localStorage.getItem("todo");
            // var datas = JSON.parse(data);
            console.log(typeof JSON.parse(data));
            console.log(JSON.parse(data)[0].title);
        })
    </script>
</body>
</html>